package com.cnunicom.modules.addressbook.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 通讯录表
 *
 * @author dingziyuan
 * @email dzy998877@163.com
 * @date 2019-07-11 10:34:23
 */
@Data
@TableName("tb_address_book")
public class AddressBookEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 *主键
	 */
	@TableId
	private Long id;
	/**
	 * 名称
	 */
	@NotBlank(message = "姓名不能为空")
	private String username;
	/**
	 * 手机号
	 */
	@Pattern(regexp = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\\\d{8}$")
	private String mobile;
	/**
	 * 所属地区id
	 */
	private String regionId;

    /**
     * 所有地区
     */
    @TableField(exist = false)
	private List<ChinaEntity> regions;
	/**
	 * 创建时间
	 */
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;
	/**
	 * 邮箱
	 */
	@Email
	private String email;
	/**
	 * 备注
	 */
	private String remark;
	/**
	 *	是否删除
	 */
	@TableLogic
	private String def0;
	/**
	 *
	 */
	private String def1;
	/**
	 *
	 */
	private String def2;
	/**
	 *
	 */
	private String def3;
	/**
	 *
	 */
	private String def4;

}
